﻿<%@ Page Title="Edit Customer" Theme="POSSystem" Language="C#" MasterPageFile="~/EditPages/Popup.Master"
    AutoEventWireup="true" CodeBehind="EditBranch.aspx.cs" Inherits="WebUI.EditPages.EditBranch" %>

<%@ Register Src="~/Controls/POSControls/EditBranchCtrl.ascx" TagPrefix="uc" TagName="EditBranch" %>
<asp:Content ID="Content1" ContentPlaceHolderID="PopupHeadHolder" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PopupToolbarHolder" runat="server">
    <script type="text/javascript">
        function btnSave_OnClick() {
            var chk = getCopyCheckbox();
            if (chk != null && chk.checked) {
                if(confirm("All data(not private information) from Headquarter will copied to this branch. This may take a few minites. Do you want to continue?"))
                    document.getElementById("<%= lnkSave.ClientID %>").click();
            }
            else
                document.getElementById("<%= lnkSave.ClientID %>").click();
            
        }

        function btnSaveAndClose_OnClick() {
            var chk = getCopyCheckbox();
            if (chk != null && chk.checked) {
                if(confirm("All data(not private information) from Headquarter will be copied to this branch. This may take a few minites. Do you want to continue?"))
                    document.getElementById("<%= lnkSaveAndClose.ClientID %>").click();
            }
            else
               document.getElementById("<%= lnkSaveAndClose.ClientID %>").click();
        }
    </script>
    
    <table class="popuptoolbar" width="100%">
        <tr>
            <td style="vertical-align: middle; text-align: left">
                <asp:LinkButton class="tbbutton" OnClientClick="btnSave_OnClick(); return false;" ID="btnSave" runat="server">
                    <img src="../Images/save.gif" /><asp:Label ID="label1" runat="server" Text=" Save"></asp:Label>
                </asp:LinkButton>
                <asp:LinkButton class="tbbutton" OnClientClick="btnSaveAndClose_OnClick(); return false;" ID="btnSaveClose" runat="server">
                    <img src="../Images/tb_SaveAndClose.gif" /><asp:Label ID="label2" runat="server"
                        Text=" Save and Close"></asp:Label>
                </asp:LinkButton>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PopupContentHolder" runat="server">
    <div style="margin-left: 35px">
        <uc:EditBranch ID="editBranch" runat="server" />

        <asp:Button class="tbbutton" style="display:none" ValidationGroup="Save" ID="lnkSave" runat="server"
            OnClick="btnSave_OnClick">
        </asp:Button>
        <asp:Button style="display:none" class="tbbutton" ValidationGroup="Save" ID="lnkSaveAndClose" runat="server"
            OnClick="btnSaveAndClose_OnClick">
        </asp:Button>
    </div>
</asp:Content>
